package com.langll.ai.mybatis;

import cn.hutool.json.JSONUtil;
import com.langll.ai.AIChatApplication;
import com.langll.ai.portfolio.service.IPortfolioProductService;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;
import java.util.Map;

/**
 * mybatis 相关测试
 */
@Slf4j
@SpringBootTest(classes = AIChatApplication.class)
@RunWith(SpringRunner.class)
public class TestConnection {
    @Autowired
    private IPortfolioProductService iPortfolioProductService;

    @Test
    public void getBusinessSegmentGroup(){
        List<Map<String, Object>> result =  iPortfolioProductService.getBusinessSegmentGroup("Consumer");
        for (Map<String, Object> map : result) {
            for (Map.Entry<String, Object> entry : map.entrySet()) {
                log.info("Key:{}, Value:{}", entry.getKey(),entry.getValue());
            }
        }
    }
}
